package prirprojekt;

public class Zadanie {

    int id;
    int[] czasyNaCPU;

    public Zadanie(int id, int[] czasyNaCPU) {
        this.id = id;
        this.czasyNaCPU = czasyNaCPU;

    }
    
    public Zadanie(int id, int ileCPU) {
        this.id = id;
        this.czasyNaCPU = new int[ileCPU];
        for(int i = 0; i < ileCPU; i++){
            this.czasyNaCPU[i] = (int) (Math.random() * 10);
            if(this.czasyNaCPU[i] == 0) this.czasyNaCPU[i] = 1;
        }
    }
    
    @Override
    public String toString(){
        String txt = "Zadanie " + this.id + " czasy => ";
        for(int i=0;i<this.czasyNaCPU.length;i++)
            txt += "CPU-" + i + ": " + this.czasyNaCPU[i] + " ";
        return txt;
    }
}
